package com.cheer.ba.view.activity;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.baidu.platform.comapi.map.D;
import com.cheer.ba.R;
import com.cheer.ba.utils.DensityUtils;
import com.cheer.ba.utils.LogUtils;
import com.cheer.ba.utils.SystemUtils;
import com.cheer.ba.view.base.BaseCommAty;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Hq on 2017/8/1.
 * 注册大礼包
 */
public class RegistGiftAty extends BaseCommAty {

    @BindView(R.id.id_gift_linear)
    LinearLayout mLinearGift;

    @BindView(R.id.id_gift_jump_img)
    ImageView mImgGift;

    @Override
    public View loadView(LayoutInflater inflater, View childView) {
        return super.loadView(inflater, inflater.inflate(R.layout.layout_regist_gift, null, false));
    }

    @Override
    protected boolean isTitleBarShow() {
        return false;
    }

    @Override
    public void initView() {
        LogUtils.LogD("跳转", "哈哈哈");
        int width = SystemUtils.getScreenWidth(aty) - (DensityUtils.dip2px(aty, 40) * 2);
        int height = width * 699 / 620;
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, LinearLayout.LayoutParams.WRAP_CONTENT);
        mLinearGift.setLayoutParams(params);

        LinearLayout.LayoutParams img = new LinearLayout.LayoutParams(width, height);
        img.setMargins(0, DensityUtils.dip2px(aty, 30), 0, 0);
        mImgGift.setLayoutParams(img);
    }

    @OnClick({R.id.id_del_aty_img, R.id.id_gift_jump_img})
    public void onClick(View mView) {
        switch (mView.getId()) {
            case R.id.id_del_aty_img:
                //删除
                finish();
                break;
            case R.id.id_gift_jump_img:
                //跳转
                if (isLogin(true)) {
                    skipActivity(aty, MyCardGroupAty.class);
                }
                break;
        }
    }

}
